package com.heu.blood.statistic.controller;

import com.heu.blood.common.aop.ControllerLogAnnotation;
import com.heu.blood.common.utils.PageUtils;
import com.heu.blood.common.utils.R;
import com.heu.blood.statistic.entity.BloodUsageRankingVo;
import com.heu.blood.statistic.service.BloodUsageRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author bearH
 * @date 2023-09-08 10:41
 */
@RestController
@RequestMapping("statistic/bloodusageranking")
public class BloodUsageRankingController {
    @Autowired
    BloodUsageRankingService bloodUsageRankingService;

    @ControllerLogAnnotation(module = "用血量排名统计", operate = "分页查询用血量排名统计")
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = bloodUsageRankingService.queryPage(params);
        return R.ok().put("page", page);
    }


    @ControllerLogAnnotation(module = "用血量排名统计", operate = "不同方式统计用血量")
    @RequestMapping("/getBloodUsageRanking")
    public R getBloodUsageRanking() {
        BloodUsageRankingVo vo = bloodUsageRankingService.getBloodUsageRanking();
        return R.ok().put("data", vo);
    }


}
